home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / addevent.h < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  53 lines

  1. // ADDEVENT.H  Special case of getevent function - while mouse
  2. //             button is pressed it returns event
  3. //             Also it reacts at mouse clicks and key press
  4. //             Scripts support is also proovided 
  5.  
  6. #ifndef __ADD_EVENT_H
  7. #define __ADD_EVENT_H
  8.  
  9. #include "event.h"
  10. #include <stdio.h>
  11. #include <string.h>
  12.  
  13. #define MAX_MACROSES 100               // Macros recursion
  14.  
  15. enum { GO, RECORD, PLAY };             // Modes
  16.  
  17. extern int scriptMode;                 // GO, RECORD, PLAY
  18. extern char* scriptFileName;           // name of script file
  19. extern char* macrosFileName;           // name of active macros file
  20. extern event e;                        // Last event in system
  21. extern FILE* scriptPtr;                // File of script
  22. extern FILE* macrosPtr;                // Macros file (usually, MACROS.MAC)
  23.  
  24. struct mac_status    // Structure keep some parameters for nested script-
  25.     {                // macros processing.
  26.     int mode;
  27.     long pos;
  28.     char* file;
  29.     FILE* ptr;
  30.     };
  31.  
  32. extern mac_status macros_stack[];    // stack for calling macros from another macros
  33. extern int macros_used;                // No of mac_status(es) in stack
  34.  
  35. struct macros_context      // When key is pressed, run macros file from
  36.     {                      // pos position
  37.     int key;
  38.     long pos;
  39.     };
  40.  
  41. extern macros_context mac_table[];           // table for macros searching
  42.                          // there are about 80 possible macroses
  43. void init_macros(); // build mac_table using current macrosFileName
  44.  
  45. mac_status macros_pop();
  46. void macros_push(mac_status);
  47. void get_command(char* c);
  48.  
  49. void get_event(int mode = 0);   // User interface function
  50.  
  51. #endif __ADD_EVENT_H
  52.  
  53.